﻿using Wicresoft.SMS.Common;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections;
using OpenSmtp.Mail;

namespace SMS.Gateway.Host.Test
{
    
    
    /// <summary>
    ///This is a test class for MailOperationTest and is intended
    ///to contain all MailOperationTest Unit Tests
    ///</summary>
    [TestClass()]
    public class MailOperationTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for MailOperation Constructor
        ///</summary>
        [TestMethod()]
        public void MailOperationConstructorTest()
        {
            MailOperation target = new MailOperation();
            Assert.Inconclusive("TODO: Implement code to verify target");
        }

        /// <summary>
        ///A test for AddEmailAddress2List
        ///</summary>
        [TestMethod()]
        [DeploymentItem("SMS.Common.dll")]
        public void AddEmailAddress2ListTest()
        {
            string Emails = string.Empty; // TODO: Initialize to an appropriate value
            ArrayList eac = null; // TODO: Initialize to an appropriate value
            MailOperation_Accessor.AddEmailAddress2List(Emails, eac);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        ///A test for BuildMailMessage
        ///</summary>
        [TestMethod()]
        [DeploymentItem("SMS.Common.dll")]
        public void BuildMailMessageTest()
        {
            EmailInfo em = null; // TODO: Initialize to an appropriate value
            MailMessage expected = null; // TODO: Initialize to an appropriate value
            MailMessage actual;
            actual = MailOperation_Accessor.BuildMailMessage(em);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for CheckMails
        ///</summary>
        [TestMethod()]
        public void CheckMailsTest()
        {
            MailOperation target = new MailOperation(); // TODO: Initialize to an appropriate value
            string host = string.Empty; // TODO: Initialize to an appropriate value
            string port = string.Empty; // TODO: Initialize to an appropriate value
            string user = string.Empty; // TODO: Initialize to an appropriate value
            string psw = string.Empty; // TODO: Initialize to an appropriate value
            EmailInfo[] expected = null; // TODO: Initialize to an appropriate value
            EmailInfo[] actual;
            actual = target.CheckMails(host, port, user, psw);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for InstanceExchangeServerAPI
        ///</summary>
        [TestMethod()]
        public void InstanceExchangeServerAPITest()
        {
            string evInfo = string.Empty; // TODO: Initialize to an appropriate value
            string ServerUrl = string.Empty; // TODO: Initialize to an appropriate value
            string Username = string.Empty; // TODO: Initialize to an appropriate value
            string Password = string.Empty; // TODO: Initialize to an appropriate value
            string Domain = string.Empty; // TODO: Initialize to an appropriate value
            string Email = string.Empty; // TODO: Initialize to an appropriate value
            MailOperation.InstanceExchangeServerAPI(evInfo, ServerUrl, Username, Password, Domain, Email);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        ///A test for InstanceSmtpClient
        ///</summary>
        [TestMethod()]
        public void InstanceSmtpClientTest()
        {
            string username = string.Empty; // TODO: Initialize to an appropriate value
            string password = string.Empty; // TODO: Initialize to an appropriate value
            string host = string.Empty; // TODO: Initialize to an appropriate value
            string port = string.Empty; // TODO: Initialize to an appropriate value
            string sender = string.Empty; // TODO: Initialize to an appropriate value
            MailOperation.InstanceSmtpClient(username, password, host, port, sender);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        ///A test for SendEmail
        ///</summary>
        [TestMethod()]
        public void SendEmailTest()
        {
            EmailInfo email = null; // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = MailOperation.SendEmail(email);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
    }
}
